package com.example.test.advice.第六章_枚举和注解.建议88_用枚举实现工厂方法模式更简洁;

public enum CarAbstractFactory {

    //定义工厂类，能生产汽车的类型
    FordCar{
        @Override
        public Car create() {
            return new FordCar();
        }
    },
    BuickCar{
        @Override
        public Car create() {
            return new BuickCar();
        }
    };

    public abstract Car create();
}
